- /* snmvaloc.cpp by K.Tsuru */
- // function ID = 101
- /***********************************
- SNumber class
- It allocates the memory of figure[].
- See "snum.h" for details.
- ************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- uint SNumber::valloc(uint sz, int copy){
- sz = max(sz, minArraySize); //It does not free the memory.
- uint max_sz = SNMaxSize(type);
- uint alcsz = (CutDown() == DISABLE) ? max(sz, figure.size()) : sz;
-
- if(alcsz > max_sz){
- if(type & REAL) alcsz = max_sz; //real number type(SDouble or SDecimal)
- else if(alcsz > MaxArraySize()) SetError(OVERFLOW_ERR, "valloc", 101);//integer
- }
-
- #ifndef NDEBUG
- int err = figure.Error();
- sz = figure.size(alcsz, copy); //change size
- assert(sz >= minArraySize);
- assert(sz <= MaxArraySize());
- err |= figure.Error();
- if(err != figure.NORMAL) SetError(FATAL, "valloc : NCBlock", err);
- #else
- sz = figure.size(alcsz, copy);
- #endif
- if(copy < 0) sign = UNDECIDED; //does not initialize
- else if(!copy) sign = ZERO;
-
- return sz;
- }
snmvaloc.cpp : last modifiled at 2015/11/27 16:05:46(1,046 bytes)
created at 2016/04/11 11:36:47
The creation time of this html file is 2017/10/27 10:59:17 (Fri Oct 27 10:59:17 2017).